package com.zzwcode.springweb.core.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
    @Bean
    public OpenAPI springDocOpenAPI() {
        return new OpenAPI().info(new Info().title("SpringWebApi文档")
                .description("SpringWebApi接口文档")
                .version("V1.0.0")
                .contact(new Contact().name("Summer").email("7267108@qq.com")));
    }

    @Bean
    public GroupedOpenApi apiGroupInfo(){
        return GroupedOpenApi.builder().group("网页API文档")
                .pathsToMatch("/api/**")
                .build();
    }
}
